package com.example.cardserver.controller;

import com.example.cardserver.entity.HeaNews;
import com.example.cardserver.service.IHeaNewsService;
import com.example.cardserver.util.JsonResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RequestMapping("heanews")
@RestController
public class HeaNewsController extends BaseController{
    @Resource
    private IHeaNewsService heaNewsService;
    
    @RequestMapping(value = "news", method = RequestMethod.POST)
    public JsonResult<List<HeaNews>> getList(){
        List<HeaNews> data = heaNewsService.listAllNews();
        return new JsonResult<List<HeaNews>>(OK,data);
    }
}
